package hiatao.puzzle.activity;

import haitao.puzzle.R;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;

public abstract class BaseActivity  extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		findViews(savedInstanceState);
		setListeners();
		setOnClick();
		init();
	}
	/** 
	 * @Description: findView
	 * @param     
	 * @return void
	 */
	protected abstract void findViews(Bundle savedInstanceState);
	   
    /** 
    * @Description: 初始化
    * @param     
    * @return void
    */
    protected abstract void init();
   
    /** 
    * @Description: 监听事件
    * @param     
    * @return void
    */
    protected abstract void setListeners();
	private void setOnClick() {
		View view = findViewById(R.id.top_back);
		if (view!=null) {
			view.setOnClickListener( new OnClickListener() {
				@Override
				public void onClick(View v) {
					BaseActivity.this.finish();
				}
			});
		}
	}
}
